Declare the specific literal route before the wildcard param route. On Express, NestJS matches routes in declaration order so GET /users/me matches the @Get('me') handler first. On Fastify a radix tree automatically prefers static routes, but declaring specific routes first is safer on both platforms.
Express matches routes in the order they are declared — specific literals must come first.
Fastify uses a radix tree that automatically prefers static segments over parametric ones.
Always declare literal routes before wildcard param routes regardless of platform — it is the safer convention.
ParseIntPipe throws BadRequestException if a non-numeric value reaches the :id handler.
This pattern extends to any reserved path segment like 'search', 'export', or 'count'.